package com.ying.timed.task;

import cn.hutool.json.JSONUtil;
import com.ying.common.entity.Response;
import com.ying.timed.service.TestService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component("TestTask")
public class TestTask {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private TestService testService;

    public void testTask(String params) {
        logger.info("===============================");
        logger.info("开始测试定时任务", params);
        Response response = testService.selectTest(params);
        logger.info(JSONUtil.toJsonStr(response));
        logger.info("结束测试定时任务", params);
        logger.info("===============================");
    }

}
